//
//  HomeAdsCell.m
//  QuLuoMianApp
//
//  Created by Sierra on 2017/12/20.
//  Copyright © 2017年 科大讯飞. All rights reserved.
//

#import "HomeAdsCell.h"

@interface HomeAdsCell()<SDCycleScrollViewDelegate>

@end

@implementation HomeAdsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI
{
    self.backgroundColor = [UIColor whiteColor];
    _cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, kScreenWidth, self.height) delegate:self placeholderImage:kImage(@"ads_banner_placeholder")];
    _cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleToFill;
    _cycleScrollView.autoScrollTimeInterval = 5.0;
    _cycleScrollView.showPageControl = NO;
    _cycleScrollView.localizationImageNamesGroup = @[@"home_ads_bg_icon"];
    
    [self addSubview:_cycleScrollView];
}


#pragma mark - 点击图片Bannar跳转
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
    NSLog(@"点击了%zd轮播图",index);
}

#pragma mark - 布局
- (void)layoutSubviews
{
    [super layoutSubviews];
}

@end
